Error Types 1. Syntax Error – An error cased by the programmer using invalid vocabulary. Things such as missing a ;. The compiler will tell you about the problem. 2. Runtime Error – When your program crashes. “Unhandled Exception”. For example when you divide by zero. 3. Logic Error – The program gives incorrect results/output. Hardest to find because it is assumed that the results are correct. Operators Unary operators – one operand ++ -- :: Prefix vs. postfix Binary operators – two operands + * - / = >> << *= += Ternary operator – three operands Only one of them its name is “the ternary operator“ Scope of a variable – where the variable is “known”. Where it can be used. Examples (with in a function, within {}) Promiscuous int postplusplus(int& i) { i++; return i - 1; } int preplusplus(int& i) { i++; return i; } void main() { int i = 0; //i++; postplusplus(i); //cout << ++i << endl; cout << preplusplus(i) << endl; cout << i << endl; //int k = i++; int k = postplusplus(i); cout << "k = " << k << endl; cout << "i = " <> i; //condition ? what to do when true : what to do when false (i > 7) ? cout << "true\n" : cout << "false\n"; int k = (i >= 50) ? 100 : 0; cout << k; } ///////////////////////////////////////// //sinful //global varibles //known as Promiscuous //no data integrity //gloabal constants are very good const int a = 0; void main() { int a = 8; //:: the scope resolution operator cout << a << ::a << endl; //for(int i = 0; i < 100; i++) //{ // cout << i << endl; //} //for(int i = 0; i < 100; i++) //{ // cout << i << endl; //} // cout << i << endl; }